deploy: Don't prune repo at finalization time by default
authorColin Walters <walters@verbum.org>
Mon, 30 Apr 2018 18:41:30 +0000 (14:41 -0400)
committerAtomic Bot <atomic-devel@projectatomic.io>
Tue, 1 May 2018 13:59:07 +0000 (13:59 +0000)
Doing so can break rpm-ostree, which wants to own the cleanup process
to ensure its baselayer refs are generated.

Further, doing the cleanup at shutdown time adds latency.  It's also
going to be generally unnecessary as we expect repo pruning to have
been done when writing the refs.

Closes: #1567
Approved by: jlebon

src/libostree/ostree-sysroot-deploy.c

index 4314520a8e3f3de91572627152c3683065168cb2..ea9dcb29ca8b73d301a2b665eb87e4bf1768fd4f 100644 (file)
@@ -2799,13 +2799,23 @@ _ostree_sysroot_finalize_staged (OstreeSysroot *self,
   staged->staged = FALSE;
   g_ptr_array_remove_index (self->deployments, 0);
 
-  /* TODO: Proxy across flags too? */
-  OstreeSysrootSimpleWriteDeploymentFlags flags = 0;
+  /* TODO: Proxy across flags too?
+   *
+   * But note that we always use NO_CLEAN to avoid adding more latency at
+   * shutdown, and also because e.g. rpm-ostree wants to own the cleanup
+   * process.
+   */
+  OstreeSysrootSimpleWriteDeploymentFlags flags =
+    OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_NO_CLEAN;
   if (!ostree_sysroot_simple_write_deployment (self, ostree_deployment_get_osname (staged),
                                                staged, merge_deployment, flags,
                                                cancellable, error))
     return FALSE;
 
+  /* Do the basic cleanup that may impact /boot, but not the repo pruning */
+  if (!ostree_sysroot_prepare_cleanup (self, cancellable, error))
+    return FALSE;
+
   return TRUE;
 }